package com.mrsad.model;

import com.mrsad.view.Observer;

public class Light extends Subject{
	private boolean on = false;
	
	public void on() {
		on = true;
		System.out.println("开");
		notifyObservers();
	}
	 
	public void off() {
		on = false;
		System.out.println("关");
		notifyObservers();
	}

	@Override
	public void notifyObservers() {
		for(Observer o:observers) {
			o.update(on);
		}
		
	}
	 
}
 
